var t = getApp();

Page({
    data: {
        id: "",
        key: "",
        From: "",
        itname: "义务"
    },
    onLoad: function(t) {
        this.setData({
            key: t.key,
            id: t.id,
            From: t.From,
            url: t.url,
            sessin: t.sessin,
            Bigid: t.Bigid
        }), "end" == t.key && this.setData({
            itname: "条款"
        });
    },
    toobliga: function() {
        var t = this.data.key, a = this.data.From, i = this.data.Bigid, e = this.data.url, l = this.data.sessin;
        wx.redirectTo({
            url: "../SdraftOblig/SdraftOblig?key=" + t + "&From=" + a + "&id=" + i + "&url=" + e + "&sessin=" + l
        });
    },
    inpusubmit: function(a) {
        var i = this.data.url, e = this.data.Bigid, l = this.data.sessin, s = this.data.id - 1, d = this.data.key, n = this.data.From, r = a.detail.value.text, o = a.detail.value.time, g = a.detail.value.posi, h = a.detail.value.cond, u = "", c = "";
        if (o.length <= 0 && (u = "该项义务的"), o.length <= 0 && g.length <= 0 && (c = "该项义务"), 
        o && (o = "\n该项义务的履行时间为：" + a.detail.value.time), g && (g = "\n" + u + "履行地点为：" + a.detail.value.posi), 
        h && (h = "\n" + c + "履行具体要求为：" + a.detail.value.cond), 1 == n) {
            m = wx.getStorageSync(d) || [];
            r.length > 0 && m.splice(s, 0, r + o + g + h), r.length, wx.setStorageSync(d, m);
        }
        if (2 == n) {
            var m = t.globalData.htGet[d] || [];
            r.length > 0 && m.splice(s, 0, r + o + g + h), r.length, t.globalData.htGet[d] = m, 
            t.globalData.alternot = 1;
        }
        wx.redirectTo({
            url: "../SdraftOblig/SdraftOblig?key=" + d + "&From=" + n + "&id=" + e + "&url=" + i + "&sessin=" + l
        });
    }
});